<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Transfer
 *
 * @property int $id 转移ID
 * @property int $from_user_id 转移自
 * @property int $to_user_id 转移至
 * @property float $number 转移数量
 * @property string|null $time 时间
 * @property-read \App\Models\User $fromUser
 * @property-read \App\Models\User $toUser
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Transfer newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Transfer newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Transfer query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Transfer whereFromUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Transfer whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Transfer whereNumber($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Transfer whereTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Transfer whereToUserId($value)
 * @mixin \Eloquent
 */
class Transfer extends Model
{
    public $timestamps = false;

    public function fromUser()
    {
        return $this->belongsTo(User::class, 'from_user_id');
    }

    public function toUser()
    {
        return  $this->belongsTo(User::class, 'to_user_id');
    }
}
